package com.campus_information_portal.util;

import java.util.List;

/**
 * @author 20155873 张联富
 * @Description $Description$
 * @methodName $methodName$
 * @date $date$ $time$
 * @return $returns$
 */
public class PageInfo<T> {
    private Integer count;//总记录数
    private Integer pageIndex;//当前页号
    public static final int pageSize=3;
    private Integer totalPages;//总页数
    private List<T> pageList;//当前页的记录的集合
    public Integer getCount() {
        return count;
    }
    /**
     * @return the totalPages
     */
    public Integer getTotalPages() {
        //return totalPages;
        if(this.count%pageSize==0){
            this.totalPages=this.count/pageSize;
        }else{
            this.totalPages=this.count/pageSize+1;
        }
        return this.totalPages;
    }
/**
 * @param totalPages the totalPages to set
 */
/*public void setTotalPages(Integer totalPages) {
	this.totalPages = totalPages;
}*/
    /**
     * @param count the count to set
     */
    public void setCount(Integer count) {
        this.count = count;
    }
    /**
     * @return the pageIndex
     */
    public Integer getPageIndex() {
        return pageIndex;
    }
    /**
     * @param pageIndex the pageIndex to set
     */
    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }
    /**
     * @return the pageList
     */
    public List<T> getPageList() {
        return pageList;
    }
    /**
     * @param pageList the pageList to set
     */
    public void setPageList(List<T> pageList) {
        this.pageList = pageList;
    }
}
